﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using edu.Model;
using edu.Service;

namespace edu.ztest
{
    public partial class DailyHomeworkTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //addTest();
            updateTest();
        }

        private void addTest()
        {
            DailyHomework entity = new DailyHomework();
            entity.Name = "name";
            entity.Code = "code";
            entity.Description = "description";
            entity.HomeworkId = 1;
            entity.StudentId = 2;
            entity.HomeworkCompleteId = 3;
            DailyHomeworkService.Add(entity);
        }

        private void updateTest()
        {
            List<DailyHomework> list = new List<DailyHomework>();

            DailyHomework entity = new DailyHomework();
            entity.Id = 0;
            entity.Name = "name1";
            entity.Code = "code1";
            entity.Description = "description1";
            entity.HomeworkId = 11;
            entity.StudentId = 22;
            entity.HomeworkCompleteId = 33;
            list.Add(entity);

            entity = new DailyHomework();
            entity.Id = 0;
            entity.Name = "name2";
            entity.Code = "code2";
            entity.Description = "description2";
            entity.HomeworkId = 111;
            entity.StudentId = 222;
            entity.HomeworkCompleteId = 3333;
            list.Add(entity);

            entity = new DailyHomework();
            entity.Id = 13;
            entity.Name = "name0";
            entity.Code = "code0";
            entity.Description = "description0";
            entity.HomeworkId = 10;
            entity.StudentId = 20;
            entity.HomeworkCompleteId = 30;
            list.Add(entity);


            DailyHomeworkService.Save(list);
        }
    }
}